; dmmScalePNG.scm - GIMP Script-Fu to Scale a PNG Image to a New Width
;    This Script-Fu must be put in The GIMP's script directory
;    (e.g., $HOME/.gimp-1.2/scripts).
;    For interactive invocation, run The GIMP and go to
;    Xtns -> Script-Fu -> dmm
;    New width is in pixels
;
(define (gimp-normalize-to-bootsplash quality infile)
   (let* ((image (car (file-jpeg-load 1 infile infile)))
         )
	
	(gimp-image-flatten image)

     	(let* ((drawable (car (gimp-image-get-active-drawable image))))

		(file-jpeg-save 1 image drawable infile infile quality 0 0 0 "Mandriva Theme" 0 1 0 0 )
	 )
   )
)

(script-fu-register                                 ; I always forget these ...
   "gimp-normalize-to-bootsplash"                                    ; script name to register
   "<Toolbox>/Xtns/Script-Fu/Mandriva/Save the jpeg image to the right format for bootsplash"       ; where it goes
   "Transform and resize xcf image to PNG and postscript"   ; script description
   "Warly"                             ; author
   "Copyright 2006 by Mandriva; GNU GPL"  ; copyright
   "2006-09-01"                                     ; date
   ""	; type of image
   SF-VALUE "Quality" "0.9"                        ; default quality
   SF-FILENAME "Infile" "infile.jpg"
)
